home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 1998 August / PC Plus SuperCD 50a Issue 142 (CD142a) (August 1998).iso / trial / demon / TURNPIKE.1 / CLASSES.ZIP / JAVA / IO / FileOutputStream.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-04-14  |  1.2 KB  |  65 lines

  1. package java.io;
  2.  
  3. public class FileOutputStream extends OutputStream {
  4.    // $FF: renamed from: fd java.io.FileDescriptor
  5.    private FileDescriptor field_0;
  6.  
  7.    public FileOutputStream(String var1) throws IOException {
  8.       SecurityManager var2 = System.security;
  9.       if (var2 != null) {
  10.          var2.checkWrite(var1);
  11.       }
  12.  
  13.       try {
  14.          this.field_0 = new FileDescriptor();
  15.          this.open(var1);
  16.       } catch (IOException var3) {
  17.          throw new FileNotFoundException(var1);
  18.       }
  19.    }
  20.  
  21.    public FileOutputStream(File var1) throws IOException {
  22.       this(var1.getPath());
  23.    }
  24.  
  25.    public FileOutputStream(FileDescriptor var1) {
  26.       SecurityManager var2 = System.security;
  27.       if (var2 != null) {
  28.          var2.checkWrite(var1);
  29.       }
  30.  
  31.       this.field_0 = var1;
  32.    }
  33.  
  34.    private native void open(String var1) throws IOException;
  35.  
  36.    public native void write(int var1) throws IOException;
  37.  
  38.    private native void writeBytes(byte[] var1, int var2, int var3) throws IOException;
  39.  
  40.    public void write(byte[] var1) throws IOException {
  41.       this.writeBytes(var1, 0, var1.length);
  42.    }
  43.  
  44.    public void write(byte[] var1, int var2, int var3) throws IOException {
  45.       this.writeBytes(var1, var2, var3);
  46.    }
  47.  
  48.    public native void close() throws IOException;
  49.  
  50.    public final FileDescriptor getFD() throws IOException {
  51.       if (this.field_0 != null) {
  52.          return this.field_0;
  53.       } else {
  54.          throw new IOException();
  55.       }
  56.    }
  57.  
  58.    protected void finalize() throws IOException {
  59.       if (this.field_0 != null) {
  60.          this.close();
  61.       }
  62.  
  63.    }
  64. }
  65.